<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>登入</title>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="keywords" content="fly,layui,前端社区">
		<meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
		<link rel="stylesheet" href="public/res/layui/css/layui.css">
		<link rel="stylesheet" href="public/res/css/global.css">
	</head>
	<body>
		<div class="header">
			<div class="main">
				<a class="logo" href="/" title="Fly">Fly社区</a>
				<div class="nav">
					<a class="nav-this" href="index.html"> <i class="iconfont icon-wenda"></i>问答 </a>
					<a href="http://www.layui.com/" target="_blank"> <i class="iconfont icon-ui"></i>框架 </a>
				</div>

				<div class="nav-user">
					<!-- 登入后的状态 -->
					<a class="avatar" href="../user/index.html"> <img src="http://tp4.sinaimg.cn/1345566427/180/5730976522/0"> <cite>贤心</cite> <i>VIP2</i> </a>
					<div class="nav">
						<a href="{:url('user/set')}"><i class="iconfont icon-shezhi"></i>设置</a>
						<a href=""><i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;"></i>退了</a>
					</div>

				</div>
			</div>
		</div>

		<div class="main layui-clear">
			<h2 class="page-title">登入</h2>
			<div class="layui-form layui-form-pane">
				<form method="post" id="form_login">
					<div class="box">
						<label for="L_email" class="input-label">邮箱</label>
						<div class="input-inline">
							<input type="text" id="L_email" name="email" required  autocomplete="off" class="input">
						</div>
					</div>
					<div class="box">
						<label for="L_pass" class="input-label">密码</label>
						<div class="input-inline">
							<input type="password" id="L_pass" name="pass" required  autocomplete="off" class="input">
						</div>
					</div>
					<div class="box">
						<a class="layui-btn" id="btn_login"> 立即登录 </a>
						<span style="padding-left:20px;"> <a href="/user/forget">忘记密码？</a> </span>
					</div>
					<div class="layui-form-item fly-form-app">
						<span>或者使用社交账号登入</span>
						<a href="" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-qq" title="QQ登入"></a>
						<a href="" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-weibo" title="微博登入"></a>
					</div>
				</form>
			</div>
		</div>
		<div class="footer">
			<p>
				<a href="http://fly.layui.com/">Fly社区</a> 2016 &copy; <a href="http://www.layui.com/">layui.com</a>
			</p>
			<p>
				<a href="http://fly.layui.com/auth/get" target="_blank">产品授权</a>
				<a href="http://fly.layui.com/jie/3147.html" target="_blank">VIP说明</a>
				<a href="http://www.layui.com/" target="_blank">商务合作</a>
				<a href="http://weibo.com/SentsinXu" target="_blank" rel="nofollow">微博</a>
				<a href="http://fly.layui.com/jie/2461.html" target="_blank">微信公众号</a>
			</p>
		</div>
		<script src="public/res/layui/layui.js"></script>
		<script>
			layui.cache.page = 'user';
			layui.cache.user = {
				username : '游客',
				uid : -1,
				avatar : '../../res/images/avatar/00.jpg',
				experience : 83,
				sex : '男'
			};
			layui.config({
				version : "1.0.0",
				base : 'public/res/mods/'
			}).extend({
				fly : 'index'
			}).use('fly', function() {
				$ = layui.jquery;

				$("#btn_login").on('click', function() {
					var vars = $("#form_login").serialize();
					var post_url = "{:url('user/check_login')}";
					$.ajax({
						type : "POST",
						url : post_url,
						data : vars,
						dataType : "json",
						success : function(ret) {
							console.log(ret);
							if (ret.status) {
								location.href = "{:url('index/index')}";
							} else {
								layer.msg(ret.info);
								return false;
							}
						}
					});
				});
			});
		</script>
	</body>
</html>